package com.cbianc.structure.adapter.class_adapter

import com.cbianc.structure.adapter.Target

//适配者接口
open class Adaptee {
    fun specificRequest() {
        println("适配者中的业务代码被调用！")
    }
}

//类适配器类
class ClassAdapter : Adaptee(), Target {
    override fun request() {
        specificRequest()
    }
}

//客户端代码
object ClassAdapterTest {
    @JvmStatic
    fun main(args: Array<String>) {
        println("类适配器模式测试：")
        val target: Target = ClassAdapter()
        target.request()
    }
}